package com.study.demo;

import com.study.demo.decorator.model.Car;
import com.study.demo.decorator.model.FlyCar;
import com.study.demo.decorator.model.WaterCar;

public class DecoratorTest {
	public static void main(String[] args) {
		Car car=new Car();
		car.move();
		System.out.println("增加飞");
		FlyCar flyCar=new FlyCar(car);
		flyCar.move();
		System.out.println("增加游");
		WaterCar waterCar=new WaterCar(car);
		waterCar.move();
		System.out.println("增加2个功能");
		WaterCar waterCar2 =new WaterCar(new FlyCar(car));
		waterCar2.move();
	}
	

}
